using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebPartPages;

namespace SmartPart
{
    /// <summary>
    /// Description of the toolpart. Override the GetToolParts method in your WebPart
    /// class to invoke this toolpart. To establish a reference to the Web Part 
    /// the user has selected, use the ParentToolPane.SelectedWebPart property.
    /// </summary>
    public class AboutToolpart : Microsoft.SharePoint.WebPartPages.ToolPart
    {
        /// <summary>
        /// Constructor for the class.
        /// </summary>
        public AboutToolpart()
        {
            this.Title = "About";
        }

        ///	<summary>
        ///	This method is called by the ToolPane object to apply property changes to the selected Web Part. 
        ///	</summary>
        public override void ApplyChanges()
        {
            // Apply property values here.
        }

        /// <summary>
        ///	If the ApplyChanges method succeeds, this method is called by the ToolPane object
        ///	to refresh the specified property values in the toolpart user interface.
        /// </summary>
        public override void SyncChanges()
        {
            // Sync with the new property changes here.
        }

        /// <summary>
        ///	This method is called by the ToolPane object if the user discards changes to the selected Web Part. 
        /// </summary>
        public override void CancelChanges()
        {
        }

        /// <summary>
        /// Render this tool part to the output parameter specified.
        /// </summary>
        /// <param name="output">The HTML writer to write out to </param>
        protected override void RenderToolPart(HtmlTextWriter output)
        {
            output.Write("SmartPart for SharePoint 2010<br>Version " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
            output.Write("<br>Created by: <a href='http://weblogs.asp.net/jan' target='_blank'>Jan Tielens</a>");
            output.Write("<br>Maintained by: <a href='http://smartpart2010.codeplex.com/' target='_blank'>CodePlex Community</a>");
        }
    }
}

